import request from '@/utils/request'
const prePath = '/drug'



//打印申论列表
export function printAssetPurchOrderList(data) {
  return request({
    url: prePath + '/purch/printList',
    method: 'post',
    data,
  })
}

//打印申论详情
export function printAssetPurchOrderDetail(data) {
  return request({
    url: prePath + '/purch/printDetail',
    method: 'post',
    data,
  })
}

//打印申论详情
export function printAssetPurchOrderDetailList(data) {
  return request({
    url: prePath + '/purch/details/printDetailList',
    method: 'post',
    data,
  })
}

//导出设备申论列表
export function exportAssetPurchOrderList(data) {
  return request({
    url: prePath + `/purch/excelList`,
    method: 'post',
    data,
    responseType: 'blob',
  })
}

export function exportAssetPurchOrderDetail(data) {
  return request({
    url: prePath + `/purch/excelDetail`,
    method: 'post',
    data,
    responseType: 'blob',
  })
}

//导出设备申论列表
export function exportAssetPurchOrderDetailList(data) {
  return request({
    url: prePath + `/purch/details/excelDetailList`,
    method: 'post',
    data,
    responseType: 'blob',
  })
}

export function getAssetPurchOrderCustomizeListPage(data) {
  return request({
    url: prePath + '/purch/customizeList/page',
    method: 'post',
    data,
  })
}
//采购单明细分组查询
export function getAssetPurchOrderCustomizeGroups(data) {
  return request({
    url: prePath + '/purch/customizeGroups',
    method: 'post',
    data,
  })
}

//创建采购单
export function createAssetPurchOrder(data) {
  return request({
    url: prePath + '/purch',
    method: 'post',
    data,
  })
}
//创建采购单 保存并提交
export function createAssetPurchOrderAndSave(data) {
  return request({
    url: prePath + '/purch/saveAndSubmit',
    method: 'post',
    data,
  })
}
//更新采购单
export function updateAssetPurchOrder(data) {
  return request({
    url: prePath + '/purch',
    method: 'put',
    data,
  })
}
//根据ID查询采购单
export function getAssetPurchOrderById(id) {
  return request({
    url: prePath + '/purch/' + id,
    method: 'get',
  })
}

//采购单明细自定义查询
export function getAssetPurchOrdersDetailCustomizeListAll(data) {
  return request({
    url: prePath + '/purch/details/customizeList/all',
    method: 'post',
    data,
  })
}
//采购单明细自定义查询
export function getAssetPurchOrdersDetailCustomizeListPage(data) {
  return request({
    url: prePath + '/purch/details/customizeList/page',
    method: 'post',
    data,
  })
}
//采购单明细分组查询
export function getAssetPurchOrdersDetailCustomizeGroups(data) {
  return request({
    url: prePath + '/purch/details/customizeGroups',
    method: 'post',
    data,
  })
}

export function removeAssetPurchOrder(data) {
  return request({
    url: prePath + '/purch',
    method: 'delete',
    data,
  })
}

export function methodAssetPurchOrder(data, method) {
  return request({
    url: prePath + '/purch/' + method,
    method: 'post',
    data,
  })
}

//采购单明细自定义查询
export function getAssetPurchOrdersDetailByContractId(data) {
  return request({
    url: prePath + '/purch/details/front/contract',
    method: 'post',
    data,
  })
}
//创建采购单 保存并提交
export function createAssetFlowSaveAndSubmit(data) {
  return request({
    url: prePath + '/purch/flowSaveAndSubmit',
    method: 'post',
    data,
  })
}
//设备收货获取采购列表
export function getPendReceivingPurchOrderList(params) {
  return request({
    url: prePath + '/purch/getPendReceivingPurchOrderList',
    method: 'get',
    params,
  })
}

